<template>
  <div class="bottom-bar">
    <div class="bar-item bar-left">
      <div class="bar-content">
        <i class="icon service">
          <img src="@/assets/img/tabbar/profile.svg">
        </i>
        <span class="text">客服</span>
      </div>
      <div class="bar-content">
        <i class="icon shop">
          <img src="@/assets/img/tabbar/home.svg">
        </i>
        <span class="text">店铺</span>
      </div>
      <div class="bar-content">
        <i class="icon select">
          <img src="@/assets/img/tabbar/category.svg">
        </i>
        <span class="text">收藏</span>
      </div>
    </div>
    <div class="bar-item bar-right">
      <div class="cart" @click="cartClick">加入购物车</div>
      <div class="buy">购买</div>
    </div>
  </div>
</template>

<script>
  export default {
    methods: {
      cartClick() {
        this.$emit("addCart")
      }
    },
  };
</script>

<style scoped>
.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 49px;
  z-index: 99;
  background-color: #fff;
  display: flex;
  text-align: center;
  border-top: 1px solid #ccc;
}
.bar-left {
  padding-top: 5px;
}
.bar-item {
  flex: 1;
  display: flex;
  justify-content: space-around;
  font-size: 13px;
}

.icon img {
  width: 18px;
  height: 18px;
  margin-bottom: 3px;
}
.bar-content {
  display: flex;
  flex-direction: column;
  align-content: space-around;
}
.bar-right {
  display: flex;
}
.bar-right .cart {
  flex: 1;
  font-size: 15px;
  line-height: 49px;
  background-color: yellow;
}
.bar-right .buy {
  flex: 1;
  font-size: 15px;
  line-height: 49px;
  color: #fff;
  background-color: rgb(247, 55, 87);
}
</style>
